package io;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("bos.txt",true);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        fos.flush();
        String line = "爱你对峙过绝望，不肯哭一场";
        fos.write(line.getBytes(StandardCharsets.UTF_8));
        bos.close();
        System.out.println("写出完毕");
    }
}
